<?php
	require_once('../_inc/app.php');
    $url = new Url();
	if($_SESSION['return_url'][3] == 0 and $_SESSION['return_url'][2] != $url->getUrl()){
		$_SESSION['return_url'][0] = $url->getUrl();
		$_SESSION['return_url'][3] = 1;
		$_SESSION['return_url']['url'] = $_SESSION['return_url'][2];
	}else if($_SESSION['return_url'][3] == 1 and $_SESSION['return_url'][0] != $url->getUrl()){
		$_SESSION['return_url'][1] = $url->getUrl();
		$_SESSION['return_url'][3] = 2;
		$_SESSION['return_url']['url'] = $_SESSION['return_url'][0];
	}else if($_SESSION['return_url'][3] == 2 and $_SESSION['return_url'][1] != $url->getUrl()){
		$_SESSION['return_url'][2] = $url->getUrl();
		$_SESSION['return_url'][3] = 0;
		$_SESSION['return_url']['url'] = $_SESSION['return_url'][1];
	}
	
    $app->prepare("admin");
    $app->process();	
    $app->render();
?>